package com.yzqp.common.mvc.base;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.Getter;

import java.util.Date;

@Data
public class BaseBean {

    public static String path;

    /**
     * 编号
     */
    @TableId(type = IdType.AUTO)
    public Long id;

    /**
     * 创建日期
     */
    @TableField
    public Long createBy = null;

    /**
     * 创建日期
     */
    @TableField
    public Date createTime = null;

    /**
     * 删除标识
     */
    @TableField
    public Boolean deleteFlag;

    /**
     * 预插入
     */
    public void preInsert(){
        this.id = null;
        this.setDeleteFlag(false);
        this.createTime = new Date();
    }
}
